package com.wisdytech.linkdcs.system.action;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wisdytech.common.bean.Filter;
import com.wisdytech.common.bean.StandardHTableResult;
import com.wisdytech.common.bean.StandardTableResult;
import com.wisdytech.linkdcs.system.model.SysResource;
import com.wisdytech.linkdcs.system.service.ISystemResourceService;

/**
 * 资源controller
 * @author dlb
 *
 */
@Controller
@RequestMapping("/resource")
public class ResourceAction {
	
	private static Logger logger =LoggerFactory.getLogger(ResourceAction.class);
	
	@Resource
	private ISystemResourceService resourceService;
	
	@RequestMapping("/index")
	private String resourceIndex() {
		return "system/resource";
	}
	
	
	@RequestMapping("/getResourceList")
	@ResponseBody
	public StandardTableResult<SysResource> getResourceTable(String parentId){
		
		StandardTableResult<SysResource> result =new StandardTableResult<>();
		List<SysResource>  resources= resourceService.listPageResource(parentId);
		result.setTotal(resources.size());
		result.setRows(resources);
		return result;
	}
	

}
